package com.tinyideatech.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tinyideatech.system.entity.SysRole;
import com.tinyideatech.system.entity.SysRoleMenu;
import com.tinyideatech.system.mapper.SysRoleMenuMapper;
import com.tinyideatech.system.service.ISysRoleMenuService;
import org.springframework.stereotype.Service;


@Service
public class SysRoleMenuServiceImpl extends ServiceImpl<SysRoleMenuMapper, SysRoleMenu> implements ISysRoleMenuService {

    @Override
    public void removeRoleMenu(SysRole role) {
        QueryWrapper<SysRoleMenu> qw = new QueryWrapper<>();
        qw.eq("role_id", role.getRoleId());
        if(super.count(qw) > 0){
            super.remove(qw);
        }
    }
}
